<!DOCTYPE html>
<html>
	<head>
		<title><?= Template::getTitle() ?></title>
        <link rel="icon" href="static/img/favicon.ico" />
		<meta charset="UTF-8"/>
		<?= Javascript::getScripts(); ?>
<?php if(0): ?>
		<link rel="stylesheet" type="text/css" href="static/css/commun.css" id="cssCommun"/>
		<link rel="stylesheet" type="text/css" href="static/css/phone.css"  media="only all and (max-width:400px)"/>
		<link rel="stylesheet" type="text/css" href="static/css/tablet.css" media="only all and (min-width:400px) and (max-width:1000px)"/>
		<link rel="stylesheet" type="text/css" href="static/css/wild.css"   media="only all and (min-width:1000px)"/>
		<!--[if lt IE 9]>
		<script type="text/javascript">
		//<![CDATA[
			// Pour les vieux IE : simule le fonctionnement des 3 lignes ci-dessus
			$(function(){
				$("link").not("#cssCommun").remove();
				var $cssIE=$('<link rel="stylesheet" type="text/css"/>').appendTo("head");
				var cssIEselected;
				$(window).bind("resize",function(){
					selectCSSIE();
				});
				var selectCSSIE=function(){
					var width=$(this).width();
					var choix=2;
					if(width<=400) choix=0;
					else if(width<=1000) choix=1;
					if(choix!=cssIEselected){
						switch(choix){
							case 0 : $cssIE.attr("href","static/css/phone.css"); break;
							case 1 : $cssIE.attr("href","static/css/tablet.css"); break;
							default: $cssIE.attr("href","static/css/wild.css"); break;
						}
						cssIEselected=choix;
					}
				}
				selectCSSIE();
			});
		//]]>
		</script>
		<![endif]-->
<?php else: ?>
		<link rel="stylesheet" type="text/css" href="static/css/wild.css"/>
<?php endif; ?>
	</head>
	<body class="<?= Main::getBodyCssClass() ?> fond<?= date('i')%4 ?>">
<?php if(Template::showDebug()): ?>
<script>
<?php
   $log=array();
   if(!empty($_POST)) $log[count($log).'._POST']=$_POST;
   if(!empty($_GET)) $log[count($log).'._GET']=$_GET;
   if(!empty($_FILES)) $log[count($log).'._FILES']=$_FILES;
   if(!empty(Message::$debugs)) $log[count($log).'.debug']=Message::$debugs;
   if(!empty(Message::$infos)) $log[count($log).'.infos']=Message::$infos;
   if(!empty(Message::$warns)) $log[count($log).'.warns']=Message::$warns;
   if(!empty(Message::$errors)) $log[count($log).'.errors']=Message::$errors;
   if(!empty(Message::$crashs)) $log[count($log).'.crashs']=Message::$crashs;
?>
    console.log(<?= json_encode($log) ?>);
</script>
<?php endif; ?>
		<div class="tplt_head">
			<a href="<?= Navig::getSiteUrl() ?>index.php" id="lienAccueil"><h1><?= Template::getMainTitle() ?></h1></a>
			<ul class="main_menu">
				<li class="main_affiche"><a href="<?= Navig::getSiteUrl() ?>affiche.php">A l"affiche</a></li>
				<li class="main_prog"><a href="<?= Navig::getSiteUrl() ?>programme.php">Programme</a></li>
				<li class="main_tarif"><a href="<?= Navig::getSiteUrl() ?>tarifs.php">Tarifs</a></li>
			</ul>
			<?php Template::getMenu(); ?>
			<div class="main_contenu">
				<h2><?= Template::getTitle() ?></h2>
				<?= Message::getCrashs() ?>
				<?= Message::getErrors() ?>
				<?= Message::getWarns() ?>
				<?= Message::getInfos() ?>